#!/bin/bash
echo "************************************************"
echo "*                                              *"
echo "*                   timse                      *"
echo "*                                              *"
echo "*    Read aerosol optical depth maps values    *"
echo "*        for some particular locations         *"
echo "*                                              *"
echo "*     Martin Aube 2001                         *"
echo "*                                              *"
echo "************************************************"
echo " "
folder=`pwd`
rm -f core
echo " Experiment directory "$folder
ls *.pgm
if [ -f timeseries.par ] 
   then
      echo " Reading parameter file."  
   else
      echo " No parameter file found!"
      epar_timse
fi 
echo " Preparing input files..."
ln -s ~/AODSEM/Bin/timeseries timeseries
echo " Executing timeseries..."
./timeseries
echo " Output file name ?"
read output
cp timeseries.cxy $output".cxy"
echo " Deleting temporary files in " $folder
rm -f timeseries
rm -f timeseries.cxy
if [ -f core ] 
   then   echo "******** An error occured during execution of timse! ********"
   rm -f core
   echo "Hit <CTRL-c> or <CRTL-z> to kill that process"
   read bidon
else
  echo " Normal end of timse." 
fi

